import logging
from dataclasses import dataclass

from src.application.category.converters import convert_category_dto_to_entity
from src.application.order.uow import OrderUoW
from src.application.proxy.dto.proxies import ProxiesDTO
from src.application.proxy.interfaces.reader.proxy_reader import GetProxiesFilters
from src.application.server.enums import ServerPrivacy, ServerType
from src.domain.user.value_objects import TelegramUserId, UserId
from src.infrastructure.db.uow import SQLAlchemyUoW

logger = logging.getLogger(__name__)


class GetAllProxiesHandler:
    def __init__(
        self,
        *,
        uow: SQLAlchemyUoW,
    ) -> None:
        self._uow = uow

    async def __call__(self) -> ProxiesDTO:
        proxies = await self._uow.proxy_reader.get_all_proxies()

        return ProxiesDTO(proxies=proxies, total=len(proxies))
